﻿using Bridge.Workflow;
using Microsoft.AspNetCore.Mvc;

namespace Bridge.WorkflowService.Host.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    public class HomeController : WorkflowController
    {
        //private readonly INotificationPublisher _notificationPublisher;

        public HomeController()
        {
            //_notificationPublisher = notificationPublisher;
        }

        public IActionResult Index()
        {
            return Redirect("/swagger");
        }

        /// <summary>
        /// This is a demo code to demonstrate sending notification to default tenant admin and host admin uers.
        /// Don't use this code in production !!!
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        //public async Task<ActionResult> TestNotification(string message = "")
        //{
        //    if (message.IsNullOrEmpty())
        //    {
        //        message = "This is a test notification, created at " + Clock.Now;
        //    }

        //    var defaultTenantAdmin = new UserIdentifier(1, 2);
        //    var hostAdmin = new UserIdentifier(null, 1);

        //    await _notificationPublisher.PublishAsync(
        //        "App.SimpleMessage",
        //        new MessageNotificationData(message),
        //        severity: NotificationSeverity.Info,
        //        userIds: new[] { defaultTenantAdmin, hostAdmin }
        //    );

        //    return Content("Sent notification: " + message);
        //}
    }
}
